from django.urls import path, include
from rest_framework.routers import SimpleRouter
from .views import ProductListView, ProductDictView, ProductHotandRecommendListView, ProductDetailView, \
    ProductDetaiDetailslView,CategoryProductsListView

urlpatterns = [
    path('dict/', ProductDictView.as_view()),
    path('', ProductListView.as_view()),  # 产品列表
    path('<int:pk>/', ProductDetailView.as_view()),  # 产品
    path('<int:pk>/details/', ProductDetaiDetailslView.as_view()),  # # 单独获取产品详情，解决加载慢的问题
    path('hot_recommend/', ProductHotandRecommendListView.as_view()),  # 推荐和热门产品列表
    path('category_products/', CategoryProductsListView.as_view()),  # 产品类别分类数据

]

# router = SimpleRouter()
# router.register('member', MemberViewSet)  # 后台会员,CRUD操作
# urlpatterns += router.urls
